<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>注册</title>
<link rel="shortcut icon" href="photo/1.png" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">   
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
 function register() {
	 var name=$("#name").val().trim();
	 var password=$("#password").val().trim();
	 if (name!=null && name!="") {
		if (password!=null && password!="") {
			$("#form_user").submit();
		} else {
			$("#register_font").text("密码不能为空！");
		}
	 }else {
		$("#register_font").text("账号不能为空！");
	 }
	
}
</script>
</head>
<body>
	<h3>注册</h3>
	<form action="<%=path %>/User/add_user" method="post" id="form_user">
	
		<input type="text" name="userName" id="name" placeholder="账号"><br>
		<input type="password" name="userPassword" id="password" placeholder="密码"><br>
		<input type="reset" value="重置">
		<input type="button" onclick="register()" value="注册">
		<a href="./Login.jsp">去登录</a>
		<font id="register_font">${register_tips }</font>
		
	</form>
</body>

</html>